package com.javaee.dao;

import com.javaee.domain.Activity;
import com.javaee.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface activityDao {

    @Select("select COUNT(*) FROM activity WHERE name = #{name}")
    public int isnameExist(Activity activity);
    @Update("insert into activity (name,actid)  values (#{name},#{actid})")
    public int add (Activity activity);

    @Select("select * from activity where actid = (#{actid})")
    public Activity getById (Integer id);

    @Select("select * from activity")
    public List<Activity> showdata ();
}
